package com.esoon.service.impl;

import com.esoon.dao.CsrServiceRecordDao;
import com.esoon.service.CsrServiceRecordService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;


import javax.annotation.Resource;

/**
 * @ClassName CsrServiceRecordServiceImpl
 * @Description TODO
 * @Author 2020/10/2 17:16
 * @Version 1.0
 **/
@Service("CsrServiceRecordServiceImpl")
public class CsrServiceRecordServiceImpl implements CsrServiceRecordService {
    private static final Logger logger;

    static {
        logger = LoggerFactory.getLogger(CsrServiceRecordServiceImpl.class);
    }
    /**
     * @Author Jack
     * @Description //TODO 默认返回2 未更新成功 sql执行成功之后返回为1 出现异常返回500
     * @Date 17:24 2020/10/2
     * @Param
     * @return
     **/

    @Resource
    private CsrServiceRecordDao csrServiceRecordDao;
    @Override
    public String updateStateByConnId(String connId, String satisfaction) {
        String result = "0";
        try {
            csrServiceRecordDao.updateStateByConnId(connId, satisfaction);
            result = "1";
            logger.info("更新坐席状态成功。");
            return result;
        }catch (Exception e){
            logger.error("更新坐席状态失败，错误信息如下" + e );
            result = "500";
        }
        return result;
    }
}
